package com.jshcbd.modules.asset.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jshcbd.modules.asset.dto.InStorageItemVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author zhoucd
 * @date
 * @description
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel( description = "资产入库明细")
@TableName("instoreage_item")
public class InStorageItemEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    public InStorageItemEntity(InStorageItemVo vo){
        BeanUtils.copyProperties(vo,this);
    }

    public InStorageItemEntity(){

    }


    private String id;

    @ApiModelProperty(value = "主表ID",required=true)
    @NotNull
    private String mainId;

    @ApiModelProperty(value = "资产名称",required=true)
    @NotNull
    private String name;

    @ApiModelProperty(value = "资产购买单位",required=true)
    @NotNull
    private String buyer;


    @ApiModelProperty(value = "资产计量单位",required=true)
    @NotNull
    private String unit;

    @ApiModelProperty(value = "资产型号",required=true)
    @NotNull
    private String model;



    @ApiModelProperty(value = "资产使用年限",required=true)
    @NotNull
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date usefulLife;

    @ApiModelProperty(value = "供应商",required=true)
    @NotNull
    private String manufacturer;

    @ApiModelProperty(value = "价格",required=true)
    @NotNull
    private BigDecimal price;

    @ApiModelProperty(value = "是否含税",required=true)
    @NotNull
    private Boolean isFax;

    @ApiModelProperty(value = "是否属于固定资产",required=true)
    @NotNull
    private Boolean isFixed;

    @ApiModelProperty(value = "资产使用时间")
    private String startUsetime;

    @ApiModelProperty(value = "折旧率")
    private BigDecimal depreciation;

    @ApiModelProperty(value = "折旧方式（1:年限平均法/2:工作量法/3:双倍余额递减法/4:年数总和法）")
    private int depreciation_way;


    @ApiModelProperty(value = "资产照片")
    private String  photo;


    @ApiModelProperty(value = "备注")
    private String  note;


    @ApiModelProperty(value = "资产分类ID",required=true)
    @NotNull
    private String classesId;


    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    /**
     * 更新时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    private String createBy;
    /**
     * 创建时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;


}
